scripty2

mixin S2.UI.Mixin.Shim

Description

Provides an implementation of a "shim" for Internet Explorer 6. On that browser, some elements (like SELECT boxes) do not adhere to vertical CSS order rules or setting z-index, because they are rendered as an OS "window", which is always above all other elements.

The solution used to solve this problem is drawing an empty IFRAME element in the background of the element that should be displayed above all other elements, acting as a "shim".

The shim will automatically adjust itself to any changes in the parent element's size or position. A positioning and/or size change can also be forced manually by calling adjustShim.

Instance methods

  • createShim #

    S2.UI.Mixin.Shim#createShim([element]) -> undefined
    • element (Element) – Optional element to shim. If omitted, will assume this.element.

    Create an IFRAME "shim" underneath the positioned element.

    Needed for IE6, which otherwise shows some UI controls (like SELECT boxes) above an element, regardless of its CSS z-index.

    Does nothing in other browsers.

  • destroyShim #

    S2.UI.Mixin.Shim#destroyShim() -> undefined

    Removes the shim.

Class methods

  • adjustShim #

    S2.UI.Mixin.Shim.adjustShim() -> undefined

    Reposition the shim, copying the dimensions and offsets of the target element.

    Note that the S2.UI.Mixin.Shim mixin attempts to do this automatically by using IE6's proprietary CSS expressions. But because such expressions can sometimes fail to update promptly, calling this method yourself may be necessary.

    Once you've called adjustShim, the shim loses the ability to dynamically update its position on its own. Subsequently, you'll have to call adjustShim again each time you update the element's layout.